From Daniel.Eisenhut at med.ge.com Thu Jan 6 22:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu Jan 6 22:55:56 2005 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 23:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jan 6 23:01:54 2005 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj@www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 14:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri Jan 7 14:29:03 2005 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj@www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 13:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun Jan 9 13:32:32 2005 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 19:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun Jan 9 19:07:20 2005 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 19:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun Jan 9 19:32:07 2005 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 10:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue Jan 11 10:26:13 2005 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 10:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jan 11 10:41:35 2005 Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj@www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 12:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue Jan 11 12:38:51 2005 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj@www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 13:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jan 11 13:35:37 2005 Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj@www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 16:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed Jan 12 18:57:51 2005 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.linuxgrrls.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment.htm From taj at www.linux.org.uk Wed Jan 12 19:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jan 12 19:18:04 2005 Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj@www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 13:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu Jan 13 21:58:06 2005 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment.html From Tivoli at pbworld.com Thu Jan 13 15:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu Jan 13 21:58:09 2005 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050113/73c10617/attachment.htm From dmarkman at mac.com Thu Jan 13 22:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu Jan 13 22:17:50 2005 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 20:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Jan 17 20:51:28 2005 Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 11:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue Jan 18 11:41:28 2005 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 12:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jan 18 12:05:05 2005 Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 12:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu Jan 20 13:07:11 2005 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 13:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jan 20 13:41:10 2005 Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj@www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 13:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu Jan 20 13:52:48 2005 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 14:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jan 20 13:58:31 2005 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 13:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu Jan 20 14:00:13 2005 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 14:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jan 20 14:05:51 2005 Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 14:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu Jan 20 14:12:20 2005 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 14:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jan 20 14:44:26 2005 Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 15:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jan 20 15:04:51 2005 Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jan 21 07:13:13 2005 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 09:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jan 21 09:35:40 2005 Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 14:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jan 21 14:52:49 2005 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 15:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri Jan 21 15:51:39 2005 Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 16:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jan 21 16:19:45 2005 Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 11:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon Jan 24 10:57:11 2005 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 13:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Jan 24 13:03:02 2005 Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 13:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Jan 24 13:49:23 2005 Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 15:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Jan 24 15:48:49 2005 Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 16:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Jan 24 16:39:35 2005 Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne@Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj@www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 15:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue Jan 25 15:47:23 2005 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 16:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue Jan 25 16:22:16 2005 Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 18:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jan 25 18:22:51 2005 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 18:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jan 25 18:28:49 2005 Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj@www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 21:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue Jan 25 21:35:17 2005 Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj@www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 10:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed Jan 26 10:15:47 2005 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 13:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed Jan 26 13:03:09 2005 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 15:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jan 26 15:49:34 2005 Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root@alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj@www.linux.org.uk From kim at poksi.ru Wed Jan 26 15:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed Jan 26 15:54:14 2005 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim@poksi.ru From taj at www.linux.org.uk Wed Jan 26 18:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jan 26 18:02:49 2005 Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj@www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 23:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed Jan 26 23:33:35 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 11:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat Jan 29 14:39:14 2005 Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 15:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Jan 29 14:56:06 2005 Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj@www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 19:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat Jan 29 19:26:14 2005 Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root@pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root@pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 20:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Jan 29 20:35:04 2005 Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root@pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root@pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj@www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 22:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun Jan 30 22:00:31 2005 Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root@pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 22:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun Jan 30 22:50:02 2005 Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root@pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj@www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 15:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon Jan 31 15:23:01 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment.bin From sean_montgomery at baseview.com Mon Jan 31 15:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon Jan 31 15:28:09 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 21:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon Jan 31 21:30:31 2005 Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 22:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Jan 31 22:23:45 2005 Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj@www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 22:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri Jun 3 17:46:54 2005 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 23:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:54 2005 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj@www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 14:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri Jun 3 17:46:54 2005 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj@www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 13:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 17:46:54 2005 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 19:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 17:46:54 2005 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 19:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 17:46:54 2005 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 10:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Fri Jun 3 17:46:54 2005 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 10:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:54 2005 Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj@www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 12:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Fri Jun 3 17:46:54 2005 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj@www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 13:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:54 2005 Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj@www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 16:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Fri Jun 3 17:46:54 2005 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0001.htm From taj at www.linux.org.uk Wed Jan 12 19:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj@www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 13:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment.htm From Tivoli at pbworld.com Thu Jan 13 15:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0002.htm From dmarkman at mac.com Thu Jan 13 22:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 20:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 11:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 12:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 12:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 13:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj@www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 13:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 14:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 13:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 14:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:55 2005 Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 14:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 14:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 15:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 09:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 14:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 15:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 16:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 11:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 13:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 13:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 15:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 16:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne@Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj@www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 15:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 16:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 18:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:56 2005 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 18:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj@www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 21:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj@www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 10:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 13:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 15:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root@alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj@www.linux.org.uk From kim at poksi.ru Wed Jan 26 15:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim@poksi.ru From taj at www.linux.org.uk Wed Jan 26 18:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj@www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 23:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 11:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 15:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:57 2005 Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj@www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 19:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root@pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root@pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 20:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root@pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root@pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj@www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 22:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root@pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 22:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:57 2005 Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root@pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj@www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 15:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0002.bin From sean_montgomery at baseview.com Mon Jan 31 15:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 21:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 22:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj@www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 22:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri Jun 3 18:09:17 2005 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 23:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:17 2005 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj@www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 14:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri Jun 3 18:09:17 2005 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj@www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 13:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 18:09:17 2005 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 19:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 18:09:17 2005 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 19:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 18:09:17 2005 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 10:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Fri Jun 3 18:09:17 2005 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 10:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:17 2005 Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj@www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 12:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Fri Jun 3 18:09:17 2005 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj@www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 13:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:17 2005 Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj@www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 16:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Fri Jun 3 18:09:17 2005 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0002.htm From taj at www.linux.org.uk Wed Jan 12 19:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj@www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 13:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0001.htm From Tivoli at pbworld.com Thu Jan 13 15:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0003.htm From dmarkman at mac.com Thu Jan 13 22:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 20:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 11:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 12:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 12:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 13:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj@www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 13:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 14:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 13:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 14:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:18 2005 Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 14:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 14:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 15:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 09:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj@www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 14:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 15:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 16:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 11:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 13:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 13:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 15:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 16:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne@Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj@www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 15:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 16:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 18:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:19 2005 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 18:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj@www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 21:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj@www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 10:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 13:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 15:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root@alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj@www.linux.org.uk From kim at poksi.ru Wed Jan 26 15:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim@poksi.ru From taj at www.linux.org.uk Wed Jan 26 18:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj@www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 23:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 11:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 15:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:20 2005 Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj@www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 19:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root@pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root@pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 20:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root@pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root@pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj@www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 22:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root@pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 22:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:20 2005 Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root@pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj@www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 15:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0003.bin From sean_montgomery at baseview.com Mon Jan 31 15:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 21:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 22:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj@www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0395.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0395.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0395.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0395.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0396.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0396.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0396.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0396.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0397.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0397.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0397.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0397.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0398.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0398.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0398.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0398.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0399.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0399.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0399.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0399.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0400.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0400.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0400.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0400.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0401.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0401.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0401.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0401.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0402.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0402.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0402.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0402.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0403.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0403.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0403.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0403.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0404.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0404.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0404.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0404.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0001.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0001.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0001.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0001.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0002.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0002.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0002.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0002.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0003.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0003.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0003.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0003.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0004.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0004.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0004.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0004.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0005.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0005.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0005.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0005.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0006.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0006.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0006.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0006.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0007.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0007.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0007.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0007.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0008.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0008.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0008.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0008.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0009.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0009.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0009.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0009.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0010.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0010.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0010.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0010.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0001.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0001.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0001.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0001.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0002.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0002.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0002.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0002.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0003.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0003.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0003.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0003.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0004.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0004.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0004.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0004.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0005.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0005.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0005.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0005.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0006.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0006.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0006.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0006.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0007.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0007.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0007.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0007.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0008.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0008.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0008.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0008.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0009.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0009.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0009.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0009.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0010.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0010.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0010.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0010.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0001.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0001.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0001.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0001.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0002.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0002.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0002.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0002.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0003.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0003.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0003.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0003.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0004.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0004.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0004.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0004.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0005.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0005.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0005.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0005.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0006.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0006.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0006.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0006.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0007.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0007.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0007.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0007.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0008.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0008.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0008.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0008.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0009.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0009.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0009.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0009.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0010.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0010.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0010.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0010.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0011.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0011.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0011.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0011.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0012.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0012.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0012.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0012.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0013.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0013.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0013.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0013.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0014.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0014.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0014.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0014.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0015.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0015.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0015.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0015.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0016.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0016.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0016.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0016.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0017.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0017.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0017.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0017.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0018.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0018.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0018.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0018.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0019.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0019.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0019.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0019.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0020.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0020.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0020.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0020.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0021.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0021.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0021.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully utilized. For what it's worth it didn't matter if I set flow control to RTSCTS (both in and out) or not. The same code running on my WinXP box using Sun's javax.comm implementation (SerialPort using the COM1 port) uses very little CPU while blocked on the read() call. Anybody else seen this? I haven't built the new 2.0-7pre2 source yet - I'm lazy and thought I'd check here first to see if the issue had been fixed in the new release or was an outstanding issue or whatever before trying to build 2.0-7pre2 :-) Thanks! Sean Montgomery From snico_one at yahoo.it Sat Jan 29 04:59:33 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 12:59:33 +0100 (CET) Subject: [Rxtx] Helpme Message-ID: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Hi, I have a problem. On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test programm) i have error: "javax.comm.UnsupportedCommOperationException: Unsupported parity value" So, i want use RXTX libraries. 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver A) Now i have error: D:\comm>java Test Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver javax.comm.NoSuchPortException Exception in thread "main" java.lang.NullPointerException at Test.(Test.java:18) at Test.main(Test.java:36) B) So i have change import javax.comm.*; with import gnu.io.*; but i have error in compilier step: D:\comm>javac Test.java Test.java:8: cannot access gnu.io.CommPortIdentifier bad class file: C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. static CommPortIdentifier idPort; ^ 1 error Where is i wrong? Can you help me? Thanks Nico Test.java --------- import javax.comm.*; //import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test() { try { idPort = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write("test".getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { Test test = new Test(); } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 08:01:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 15:01:43 +0000 (GMT) Subject: Mark Parity and JRE 1.4.2 forward compatability with jre 1.5 was [Rxtx] Helpme In-Reply-To: <20050129115933.69077.qmail@web41202.mail.yahoo.com> References: <20050129115933.69077.qmail@web41202.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > I have a problem. > > On my pc (a old Celeron 633 Mhz) i want use JavaComm with PARITY_MARK. > > I installed Sun JDK 1.4.2 and SUN JCA 2.0, but when i run Test.class (a simple test > programm) i have error: > > "javax.comm.UnsupportedCommOperationException: Unsupported parity value" > > > So, i want use RXTX libraries. > > 1. i use the last "rxtx-2.1-CVS-20050120-bins" files. > > 2. i copy RXTXcomm.jar on C:\j2sdk1.4.2_05\jre\lib\ext > > 3. i copy rxtx*.dll on C:\j2sdk1.4.2_05\jre\bin > > 4. i change javax.comm.properties with Driver=gnu.io.RXTXCommDriver > > > A) Now i have error: > > D:\comm>java Test > Caught java.lang.UnsupportedClassVersionError: gnu/io/RXTXCommDriver (Unsupported > major.minor version 49.0) while loading driver gnu.io.RXTXCommDriver > javax.comm.NoSuchPortException > Exception in thread "main" java.lang.NullPointerException > at Test.(Test.java:18) > at Test.main(Test.java:36) > > > B) So i have change import javax.comm.*; > with import gnu.io.*; > > but i have error in compilier step: > > D:\comm>javac Test.java > Test.java:8: cannot access gnu.io.CommPortIdentifier > bad class file: > C:\j2sdk1.4.2_05\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPortIdentifier.class) > class file has wrong version 49.0, should be 48.0 > Please remove or make sure it appears in the correct subdirectory of the classpath. > static CommPortIdentifier idPort; > ^ > 1 error > > > Where is i wrong? > Can you help me? > I did not realize that JRE 1.4.2 can not load 1.5 class files. So you will want to use the 1.5 JRE for now. I'll build the jars with JDK 1.4.2 in the future and this problem will go away. There should be 1.4 forward incompatibilites with 1.5 built classes but not 1.5 incompatibilies with 1.4 built classes. http://java.sun.com/j2se/1.5.0/compatibility.html There is code in rxtx to handle mark parity. I've alsways tested such changes with a loopback connection though. It may work or it may need to have a C programmer look through the code with a mark parity external device connexted. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sat Jan 29 12:31:54 2005 From: snico_one at yahoo.it (Nicola) Date: Sat, 29 Jan 2005 20:31:54 +0100 (CET) Subject: [Rxtx] Parity-Mark 2 Message-ID: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Hi, now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) A) In Windows i used: 1. copy RXTXComm.jar in ...\jre\lib\ext 2. copy *.dll in ...\jre\bin 3. del javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run and all is OK : D:\ftproot>java Test COM1 Hello Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 D:\ftproot> B) In Linux i used: 1. cp RXTXComm.jar in ...\jre\lib\ext 2. cp *.so in /usr/java/rxtx 3. rm javax.com.properties 4. in Test.java import gnu.io.*; Compiler, run but i have a error : [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Parity missed 3 gnu.io.UnsupportedCommOperationException: Invalid Parameter [root at pic work]# The java programm Test.java is not changed from Windows to Linux. Where is my wrong ? 1000 Grazie Nico import gnu.io.*; import java.io.*; public class Test { static CommPortIdentifier idPort; static SerialPort serialPort; static OutputStream outStream; static String owner = ""; public Test(String port, String message){ try { idPort = CommPortIdentifier.getPortIdentifier(port); } catch(NoSuchPortException e) { System.out.println(e); } try { serialPort = (SerialPort) idPort.open(owner, 2000); } catch(PortInUseException e) { System.out.println(e); } try { outStream = serialPort.getOutputStream(); } catch(IOException e) { System.out.println(e); } try { serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_MARK); } catch(UnsupportedCommOperationException e) { System.out.println(e); } try { outStream.write(message.getBytes()); } catch(IOException e) { System.out.println(e); } serialPort.close(); } public static void main(String[] args) { if(args.length < 2) { System.out.println("Usage java Test "); } else { Test test = new Test(args[0], args[1]); } } } ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sat Jan 29 13:40:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 29 Jan 2005 20:40:45 +0000 (GMT) Subject: [Rxtx] Parity-Mark 2 In-Reply-To: <20050129193155.30550.qmail@web41210.mail.yahoo.com> References: <20050129193155.30550.qmail@web41210.mail.yahoo.com> Message-ID: On Sat, 29 Jan 2005, Nicola wrote: > Hi, > > now i use SUN JDK 5 on WinXP and Mandrake 10.1 (kernel 2.6.8.1-12mdk-i586) > > A) In Windows i used: > > 1. copy RXTXComm.jar in ...\jre\lib\ext > 2. copy *.dll in ...\jre\bin > 3. del javax.com.properties > 4. in Test.java import gnu.io.*; > > Compiler, run and all is OK : > > D:\ftproot>java Test COM1 Hello > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > > D:\ftproot> > > > > B) In Linux i used: > > 1. cp RXTXComm.jar in ...\jre\lib\ext > 2. cp *.so in /usr/java/rxtx > 3. rm javax.com.properties > 4. in Test.java import gnu.io.*; > > > Compiler, run but i have a error : > > [root at pic work]# java -Djava.library.path=/usr/java/rxtx Test /dev/ttyS0 Hello > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Parity missed 3 > gnu.io.UnsupportedCommOperationException: Invalid Parameter > [root at pic work]# > > > The java programm Test.java is not changed from Windows to Linux. > > Where is my wrong ? try placing: #include In the top of src/SerialImp.c and recompile. This may be the same bug we saw earlier in the list. -- Trent Jarvi taj at www.linux.org.uk From snico_one at yahoo.it Sun Jan 30 15:06:27 2005 From: snico_one at yahoo.it (Nicola) Date: Sun, 30 Jan 2005 23:06:27 +0100 (CET) Subject: [Rxtx] termios error Message-ID: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Hi Trent, Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: I insert into src/SerialaImp.c (on top) the line #include then i run ./autogen.sh ./configure with result OK. But when run make i have a error: .... gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo In file included from /usr/include/termios.h:40, from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: /usr/include/bits/termios.h:30: error: redefinition of `struct termios' mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or directory make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 [root at pic rxtx-2.1-CVS-20050120]# There is a conflit with termios file. What i do, now? Thank you, very much. Nico PS If i run make without there isn't error. ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Sun Jan 30 15:56:00 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 30 Jan 2005 22:56:00 +0000 (GMT) Subject: [Rxtx] termios error In-Reply-To: <20050130220627.76184.qmail@web41208.mail.yahoo.com> References: <20050130220627.76184.qmail@web41208.mail.yahoo.com> Message-ID: On Sun, 30 Jan 2005, Nicola wrote: > Hi Trent, > > Thank for the previous reply, but now i have a new problem with rxtx-2.1-CVS-20050120: > > I insert into src/SerialaImp.c (on top) the line > > #include > > then i run > > ./autogen.sh > ./configure > > with result OK. > > But when run make i have a error: > > .... > gcc -I/usr/rxtx/rxtx-2.1-CVS-20050120 -Ii586-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0/include -I/usr/java/jdk1.5.0/include/./linux/ -g -O2 -D_POSIX_SOURCE > -D_BSD_SOURCE -D__need_timespec -c /usr/rxtx/rxtx-2.1-CVS-20050120/./src/SerialImp.c > -fPIC -DPIC -o /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo > In file included from /usr/include/termios.h:40, > from /usr/rxtx/rxtx-2.1-CVS-20050120/src/SerialImp.c:52: > /usr/include/bits/termios.h:30: error: redefinition of `struct termios' > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* > (cd /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu && ln -s SerialImp.lo SerialImp.o) > gcc -shared /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo -lpthread > -Wl,-soname -Wl,librxtxSerial-2.1-7pre20.so -o .libs/librxtxSerial-2.1-7pre20.so > gcc: /usr/rxtx/rxtx-2.1-CVS-20050120/i586-pc-linux-gnu/SerialImp.lo: No such file or > directory > make: *** [i586-pc-linux-gnu/librxtxSerial.la] Error 1 > [root at pic rxtx-2.1-CVS-20050120]# > > > There is a conflit with termios file. > > What i do, now? > > Thank you, very much. what I want defined is CMSPAR. So just doing: #define CMSPAR 010000000000 Would get the code working. CMSPAR is only defined in asm/termbits.h. I suspect it should not be there or should also be in bits/termios.h. I cant see how to include the CMSPAR definition without problems. The asm/termbits.h has a termios struct that should probably only be visable to the kernel (ifdef __KERNEL__). This structure is smaller than what glibc uses and I know its caused problems when used in the past. termios.h is what we need to include for most of this information. It will include bits/termios.h. I'm not sure why some of the information is in asm/termbits.h. The reason code worked on windows is we provided the CMSPAR define in win32termios.h. I think the kernel headers may be a bit goofy from the userland perspective. I'll ask around about this. For now, you can just define CMSPAR instead of doing the include. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Mon Jan 31 08:29:09 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:29:09 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: <4a356f39389c4996503cc89e3dba5f5c@baseview.com> Hello again. Ok, I've enclosed a short concrete example at the end of this email... using the setup I mentioned before it maxes out the CPU usage when it hits the blocking read on the serial port InputStream. It's not supposed to do that, is it? On Jan 26, 2005, at 6:38 PM, Sean Montgomery wrote: > Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. > RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial > port adapter thingy. > > I've got some simple code that creates a SerialPort (using a Keyspan > adapter port), leaves the serial port params at their defaults, gets > the InputStream, and calls read() on the InputStream. The read() > call blocks just fine if there's no data available. > > Unfortunately while read() is blocking the CPU utilization goes > through the roof - Apple's Activity Monitor shows the CPU fully > utilized. For what it's worth it didn't matter if I set flow control > to RTSCTS (both in and out) or not. > import java.io.*; import java.util.Enumeration; import javax.comm.*; class ReadTest { public static void main(String[] args) { SerialPort serialPort = null; Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier portID = (CommPortIdentifier) ports.nextElement(); int portType = portID.getPortType(); if (portType == CommPortIdentifier.PORT_SERIAL) { String portName = portID.getName(); if (portName.equals("/dev/tty.USA281b13P1.1")) { CommPort commPort; try { commPort = portID.open("ReadTest", 1000); } catch (PortInUseException e) { throw new RuntimeException("Whoops! Port in use"); } if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; break; } else { commPort.close(); throw new RuntimeException("Whoops! Not a serial port"); } } } } if (serialPort != null) { try { InputStream inputStream = serialPort.getInputStream(); int anInt = inputStream.read(); // This is the place while (anInt != -1) { anInt = inputStream.read(); } } catch (IOException e) { serialPort.close(); throw new RuntimeException("Whoops! Can't get InputStream"); } } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4449 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050131/7e5cc99a/attachment-0021.bin From sean_montgomery at baseview.com Mon Jan 31 08:34:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Mon, 31 Jan 2005 10:34:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Meh. Sorry about the ugly mime-encoded source in the previous email, I wasn't paying attention :-( From snico_one at yahoo.it Mon Jan 31 14:36:39 2005 From: snico_one at yahoo.it (Nicola) Date: Mon, 31 Jan 2005 22:36:39 +0100 (CET) Subject: [Rxtx] Parity Mark - 3 Message-ID: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Hi Trent, i have a news good, on top of /src/SerialImp.c i insert only the line #define CMSPAR 010000000000 then run autogen, config, make, make install Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in Windows/Linux. My scope is to use Linux on ViaEpia as master of 485 network with microchip pic used as slave. Mark/Space parity is very important for my net protocol, so the slave not received any frame and it work well. Now i must understand your API for management the RS485. Bye Nico PS. Thanks for all ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From taj at www.linux.org.uk Mon Jan 31 15:29:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 31 Jan 2005 22:29:57 +0000 (GMT) Subject: [Rxtx] Parity Mark - 3 In-Reply-To: <20050131213639.28668.qmail@web41204.mail.yahoo.com> References: <20050131213639.28668.qmail@web41204.mail.yahoo.com> Message-ID: On Mon, 31 Jan 2005, Nicola wrote: > Hi Trent, > > i have a news good, > > on top of /src/SerialImp.c i insert only the line > > #define CMSPAR 010000000000 > > then run autogen, config, make, make install > > Now SerialWrite work OK, it send data with PARITY_MARK, PARITY_SPACE in > Windows/Linux. > > My scope is to use Linux on ViaEpia as master of 485 network with > microchip pic used as slave. > > Mark/Space parity is very important for my net protocol, so the slave > not received any frame and it work well. > > Now i must understand your API for management the RS485. > RS485 is problematic. You will want to do any RS485 control line code in the native C not from Java. The Java side sees ~10MS latency. You will also find the kernel makes no garantees concerning latency. It is possible to do RS485 with hand tuning of the native code and possibly the kernel (real time Linux) but its really beyond the scope of rxtx to provide a consitant usable API for RS485 as no distributed kernel garantees the latency required. The code for line control is in RS485Imp.c for people willing to hack. It is just a dated version of SerialImp.c. One could just start with SerialImp.c, modify and replace the RS485 code after examining the line control bits. Good luck. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Thu Jan 6 15:56:54 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Thu, 6 Jan 2005 16:56:54 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. The failure message during install is as follows: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Removing the @ silencing the command in the Makefile gives you this: # make install make all-am make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ if [ -f $i ];then \ echo $i; \ fi; \ done` libtool: install: `i686-pc-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 @@ -29,4 +29,4 @@ dlpreopen='' # Directory that this library needs to be installed in: -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? Thanks... Dan From taj at www.linux.org.uk Thu Jan 6 16:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 6 Jan 2005 23:01:53 +0000 (GMT) Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 In-Reply-To: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> References: <65E50D2CD54E9649B6CAA522C3EF659174637B@MKEMLVEM08.e2k.ad.ge.com> Message-ID: On Thu, 6 Jan 2005, Eisenhut, Daniel (GE Healthcare) wrote: > I've ran into a problem trying to install rxtx using sun's jdk-1.5.0.01. I have a Gentoo system (2004.2) which is currently working fine when using sun-jdk-1.4.2.06 but failing when using sun-jdk-1.5.0.01. I'm using rxtx-2.0-7pre1 with comm.jar from javax.comm-2_0_3. > > The failure message during install is as follows: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Removing the @ silencing the command in the Makefile gives you this: > > # make install > make all-am > make[1]: Entering directory `/root/java-stuff/rxtx-2.0-7pre1' > make[1]: Leaving directory `/root/java-stuff/rxtx-2.0-7pre1' > /root/java-stuff/rxtx-2.0-7pre1/libtool --mode=install /bin/install -c \ > `for i in i686-pc-linux-gnu/librxtxSerial.la i686-pc-linux-gnu/librxtxParallel.la;do \ > if [ -f $i ];then \ > echo $i; \ > fi; \ > done` > libtool: install: `i686-pc-linux-gnu' must be an absolute directory name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > No difference here between the sun-jdk-1.4.2.06 and sun-jdk-1.5.0.01. But when I look at the librxtxSerial.la and librxtxParallel.la files there is a difference: (--- is 1.4.2 version and +++ is 1.5.0 version) > > --- ../librxtxSerial.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxSerial.la 2005-01-06 16:38:35.880295976 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/SerialImp.lo' > > > --- ../librxtxParallel.la 2005-01-06 16:22:08.000000000 -0600 > +++ i686-pc-linux-gnu/librxtxParallel.la 2005-01-06 16:38:36.297232592 -0600 > @@ -29,4 +29,4 @@ > dlpreopen='' > > # Directory that this library needs to be installed in: > -libdir='/opt/sun-jdk-1.4.2.06/jre/lib/i386' > +libdir='/root/java-stuff/rxtx-2.0-7pre1/i686-pc-linux-gnu/ParallelImp.lo' > > > Somehow the destination directory is getting screwed up when the installed java is 1.5 and is being replaced with a file in the source. Manually editing those files before install doesn't correct the issue. Has anybody else seen this or know anything about this issue? > Hi Dan I think the easiest way to fix this is to edit configure Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The above needs a case for 1.5 Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*) Run configure again and build. This should fix everything. If you know how to use autoconf, configure.in can be edited instead but just changing that line in configure is all that is really needed. -- Trent Jarvi taj at www.linux.org.uk From Daniel.Eisenhut at med.ge.com Fri Jan 7 07:30:23 2005 From: Daniel.Eisenhut at med.ge.com (Eisenhut, Daniel (GE Healthcare)) Date: Fri, 7 Jan 2005 08:30:23 -0600 Subject: [Rxtx] make install failing using sun-jdk-1.5.0.01 Message-ID: <65E50D2CD54E9649B6CAA522C3EF659174637C@MKEMLVEM08.e2k.ad.ge.com> >Hi Dan > >I think the easiest way to fix this is to edit configure > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*) > > >The above needs a case for 1.5 > >Linux) > LDFLAGS=-lpthread > check_kernel_headers > check_java_headers > CFLAGS=$CFLAGS" -D__need_timespec" > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*) > > >Run configure again and build. > >This should fix everything. If you know how to use autoconf, configure.in >can be edited instead but just changing that line in configure is all that >is really needed. > > >-- >Trent Jarvi >taj at www.linux.org.uk I modified all four instances of "case $JAVA_VERSION in" in configure to include "1.5*" and everything appears to work fine now. Thanks. Dan From moritz.gmelin at gmx.de Sun Jan 9 06:33:08 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 14:33:08 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i Message-ID: Hi List members, I wrote an application that is supposed to communicate with a Nokia 6310i through a serial cable and receive SMS messages. It's a Java application using RXTX. The application works on Linux, MacOS X. But on Windows, I don't get any reply on my AT\r commands. If I use a Siemens S55 instead, the application works with Windows too. HyperTerminal has no problems with any of those phones..... Does anybody know if I need to set any special communication parameters with Nokia ? I'm using 115200 / 8 / N and No Flow control just as Hyperterminal does. And yes, I am using the most recent RXTX Build. Please Help ! M. From moritz.gmelin at gmx.de Sun Jan 9 12:07:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:07:59 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: I might add to this, that the phone acutally gets the commands, but I don't receive any answers. I can send a ATDT sequence and the phone dials the numbers. Sending just AT or ATZ does not give me anything on the InputStream. Neither do I get notified on DATA_AVAILABLE, nor is available() giving me anything but 0. M. Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > Hi List members, > > I wrote an application that is supposed to communicate with a Nokia > 6310i through a serial cable and receive SMS messages. > It's a Java application using RXTX. > The application works on Linux, MacOS X. But on Windows, I don't get > any reply on my AT\r commands. > If I use a Siemens S55 instead, the application works with Windows too. > HyperTerminal has no problems with any of those phones..... > Does anybody know if I need to set any special communication > parameters with Nokia ? > > I'm using 115200 / 8 / N and No Flow control just as Hyperterminal > does. > > And yes, I am using the most recent RXTX Build. > > Please Help ! > > M. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Sun Jan 9 12:32:47 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Sun, 9 Jan 2005 20:32:47 +0100 Subject: [Rxtx] RXTX, Windows and Nokia 6310i In-Reply-To: References: Message-ID: <3DF4C6B0-6275-11D9-959C-000A95BC7E8A@gmx.de> Switching on RTS_CTS FlowControl fixed it. M. Am 09.01.2005 um 20:07 schrieb Moritz Gmelin: > I might add to this, that the phone acutally gets the commands, but I > don't receive any answers. > I can send a ATDT sequence and the phone dials the numbers. > Sending just AT or ATZ does not give me anything on the InputStream. > Neither do I get notified on DATA_AVAILABLE, nor is available() giving > me anything but 0. > > M. > > Am 09.01.2005 um 14:33 schrieb Moritz Gmelin: > >> Hi List members, >> >> I wrote an application that is supposed to communicate with a Nokia >> 6310i through a serial cable and receive SMS messages. >> It's a Java application using RXTX. >> The application works on Linux, MacOS X. But on Windows, I don't get >> any reply on my AT\r commands. >> If I use a Siemens S55 instead, the application works with Windows >> too. >> HyperTerminal has no problems with any of those phones..... >> Does anybody know if I need to set any special communication >> parameters with Nokia ? >> >> I'm using 115200 / 8 / N and No Flow control just as Hyperterminal >> does. >> >> And yes, I am using the most recent RXTX Build. >> >> Please Help ! >> >> M. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From roberto.tavares at gmail.com Tue Jan 11 03:27:16 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 08:27:16 -0200 Subject: [Rxtx] Serial linux read problem Message-ID: <8d442b380501110227423acfc3@mail.gmail.com> Hello, I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing some trouble. Does anyone have an idea of what is happen? I know that my serial port is fine, I'v already use a Linux terminal-emulator to test it. I could write some stuff directly on /dev/cua0 with no problem. But when I try to detect a port or read it, I got: javax.comm.NoSuchPortException. I use two codes: 1st one: CommPortIdentifier portId; Enumeration enum = CommPortIdentifier.getPortIdentifiers(); System.out.println("Ports found:"); while (enum.hasMoreElements()){ portId = (CommPortIdentifier) enum.nextElement(); System.out.println(" - " + portId.getName()); } gives to me: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 Ports found: - /dev/ttyS0 2nd one: System.out.println("Read: start..."); portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); //I tried it also with //portName = "/dev/cua/0"; //portName = "/dev/cua0"; //portName = "\\dev\\cua\\0 SerialPort port = (SerialPort) portId.open("lpt", 5000); java.io.InputStream in = port.getInputStream(); System.out.println("[" + portName + "] 'read()' test (0, 0):"); System.out.println("Read: done..."); port.disableReceiveTimeout(); port.disableReceiveThreshold(); int val; val = in.read(); System.out.println("[" + val + "]"); port.close(); gives to me an exception with the stack trace bellow: javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) at lpt.main(lpt.java:21) Well, I really do not know where to go from here. Does anyone have any idea of what am I doing wrong? (since that are my first steps into rxtx world, I believe that could be kind of silly questions, but I really do not know where to go from here) Thanks! Roberto From taj at www.linux.org.uk Tue Jan 11 03:42:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 10:42:38 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b380501110227423acfc3@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Hello, > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > some trouble. Does anyone have an idea of what is happen? > > I know that my serial port is fine, I'v already use a Linux > terminal-emulator to test it. > > I could write some stuff directly on /dev/cua0 with no problem. > > But when I try to detect a port or read it, I got: > javax.comm.NoSuchPortException. > > I use two codes: > > 1st one: > CommPortIdentifier portId; > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > System.out.println("Ports found:"); > while (enum.hasMoreElements()){ > portId = (CommPortIdentifier) enum.nextElement(); > System.out.println(" - " + portId.getName()); > } > gives to me: > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > Ports found: > - /dev/ttyS0 > > 2nd one: > System.out.println("Read: start..."); > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > //I tried it also with > //portName = "/dev/cua/0"; > //portName = "/dev/cua0"; > //portName = "\\dev\\cua\\0 > SerialPort port = (SerialPort) portId.open("lpt", 5000); > java.io.InputStream in = port.getInputStream(); > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > System.out.println("Read: done..."); > port.disableReceiveTimeout(); > port.disableReceiveThreshold(); > int val; > val = in.read(); > System.out.println("[" + val + "]"); > port.close(); > gives to me an exception with the stack trace bellow: > javax.comm.NoSuchPortException > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > at lpt.main(lpt.java:21) > > > Well, I really do not know where to go from here. Does anyone have any > idea of what am I doing wrong? (since that are my first steps into > rxtx world, I believe that could be kind of silly questions, but I > really do not know where to go from here) > > Thanks! > > Roberto On Linux the device is /dev/ttyS0. As far as I know the cuaN are included for historical reasons only. The devices would need to be added to RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line with cua. I dont think there is any good reason to encourage people to code cua on Linux though. It should also be possible to override the enumeration as described in the INSTALL file that comes with the source. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Tue Jan 11 05:39:56 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Tue, 11 Jan 2005 10:39:56 -0200 Subject: [Rxtx] Serial linux read problem In-Reply-To: References: <8d442b380501110227423acfc3@mail.gmail.com> Message-ID: <8d442b3805011104397d96006e@mail.gmail.com> Wow! it's working! :-D Well, I can read, write, echo, and all stuff. There is just one thing left: is there a way to set the serial por parameters? I tried to follow a SUN code, on http://java.sun.com/developer/releases/javacomm/SimpleRead.java There one have the following line: serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); That I copy to my code and get a NullPointerException. Any idea? Thanks! Roberto PS: By the way, I'm posting my code and a Brazilian Portuguese how-to at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . On Tue, 11 Jan 2005 10:42:38 +0000 (GMT), Trent Jarvi wrote: > On Tue, 11 Jan 2005, Roberto Tavares wrote: > > > Hello, > > > > I'm trying to use rxtx on Mandrake Linux 9.2, but I am experiencing > > some trouble. Does anyone have an idea of what is happen? > > > > I know that my serial port is fine, I'v already use a Linux > > terminal-emulator to test it. > > > > I could write some stuff directly on /dev/cua0 with no problem. > > > > But when I try to detect a port or read it, I got: > > javax.comm.NoSuchPortException. > > > > I use two codes: > > > > 1st one: > > CommPortIdentifier portId; > > Enumeration enum = CommPortIdentifier.getPortIdentifiers(); > > System.out.println("Ports found:"); > > while (enum.hasMoreElements()){ > > portId = (CommPortIdentifier) enum.nextElement(); > > System.out.println(" - " + portId.getName()); > > } > > gives to me: > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > Ports found: > > - /dev/ttyS0 > > > > 2nd one: > > System.out.println("Read: start..."); > > portId = CommPortIdentifier.getPortIdentifier("\\dev\\cua0"); > > //I tried it also with > > //portName = "/dev/cua/0"; > > //portName = "/dev/cua0"; > > //portName = "\\dev\\cua\\0 > > SerialPort port = (SerialPort) portId.open("lpt", 5000); > > java.io.InputStream in = port.getInputStream(); > > > > System.out.println("[" + portName + "] 'read()' test (0, 0):"); > > System.out.println("Read: done..."); > > port.disableReceiveTimeout(); > > port.disableReceiveThreshold(); > > int val; > > val = in.read(); > > System.out.println("[" + val + "]"); > > port.close(); > > gives to me an exception with the stack trace bellow: > > javax.comm.NoSuchPortException > > at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:430) > > at lpt.main(lpt.java:21) > > > > > > Well, I really do not know where to go from here. Does anyone have any > > idea of what am I doing wrong? (since that are my first steps into > > rxtx world, I believe that could be kind of silly questions, but I > > really do not know where to go from here) > > > > Thanks! > > > > Roberto > > On Linux the device is /dev/ttyS0. As far as I know the cuaN are included > for historical reasons only. The devices would need to be added to > RXTXCommDriver.java to be enumerated. Just search for ttyS and add a line > with cua. I dont think there is any good reason to encourage people to > code cua on Linux though. It should also be possible to override the > enumeration as described in the INSTALL file that comes with the source. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > Q. How does rxtx detect ports? Can I override it? > > rxtx tries to detect ports on by scanning /dev for files matching any > of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. > Any ones that exist, are supposed to be good for the current operating > system, and that can be read and written are offered back from > CommPortIdentifier.getPortIdentifiers(), and only these can be used as > ports. > > If you wish, you can set the system properties gnu.io.rxtx.SerialPorts > and gnu.io.rxtx.ParallelPorts. If either of these is set, then no > scanning will be carried out and only the specified ports will be > available. You can use this to make one platform look like another, > to restrict Java access to ports, or possibly for other reasons. For > example > > java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp > > will look kind of like Solaris, if you have created the appropriate > device nodes. > > -- > Trent Jarvi > taj at www.linux.org.uk > From taj at www.linux.org.uk Tue Jan 11 06:36:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 11 Jan 2005 13:36:44 +0000 (GMT) Subject: [Rxtx] Serial linux read problem In-Reply-To: <8d442b3805011104397d96006e@mail.gmail.com> References: <8d442b380501110227423acfc3@mail.gmail.com> <8d442b3805011104397d96006e@mail.gmail.com> Message-ID: On Tue, 11 Jan 2005, Roberto Tavares wrote: > Wow! it's working! :-D > > Well, I can read, write, echo, and all stuff. > > There is just one thing left: is there a way to set the serial por parameters? > > I tried to follow a SUN code, on > http://java.sun.com/developer/releases/javacomm/SimpleRead.java > > There one have the following line: > serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > That I copy to my code and get a NullPointerException. > > Any idea? > > Thanks! > > Roberto > > PS: By the way, I'm posting my code and a Brazilian Portuguese how-to > at http://www.tavares.eng.br/modules/edito/edito.php?idedito=8 . > > I supect serialPort is null. Perhaps the code was pasted into the wrong part of your program. I'm not able to view your web page yet but the problem is much like the following: public class Tester { public void test() { } public static void main( String args[] ) { Tester t = new Tester(); t = null; t.test(); } } Moving t.test() above t = null; solves the problem. -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Wed Jan 12 09:49:20 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Wed, 12 Jan 2005 11:49:20 -0500 Subject: [Rxtx] No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050112/e7a71c74/attachment-0022.html From taj at www.linux.org.uk Wed Jan 12 12:19:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 12 Jan 2005 19:19:30 +0000 (GMT) Subject: [Rxtx] No enumera todos los puertos In-Reply-To: References: Message-ID: On Wed, 12 Jan 2005, alejandro Escobar wrote: > > Buenos dias, > > Mi ingles no es muy bueno, as? que escribo en espa?ol. > > Estoy ejecutando el siguiente codigo: > > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > System.out.println( "portId.getPortType() " + portId.getPortType()); > > System.out.println( "portId.getName() " + portId.getName()); > > } > > ? > > El programa me arroja que los puertos son /dev/ttyS0 y /dev/lp0. > > En mi maquina tengo una tarjeta equinox de 16 puertos seriales, por que > estos puertos no son listados?? > > Mi S.O es linux Red Hat 8.0 kernel 2.4.18-24 > > La versi?n de rxtx es la 2.1-7pre17 > > ? > > Por que no lista todos los puertos seriales?? > > Los puertos estan bien, porque actualmente lee los puertos con un programa > realizado en c y llamo ese programa por medio de java saliendo al sistema. > Esto es muy costoso aunque funciona, pero quiero cambiar. > > > > Wed Jan 12 12:04:52 $ ls -ld /var/lock drwxrwxr-x 3 root lock 4096 Jan 12 04:02 /var/lock/ group lock---------------^^^ /etc/groups ... lock:x:54:jarvi,user2,user3,user4 users -----^^^---^^^ su - jarvi java MyApp /dev/ttyS0 ls -l /var/lock -r--r--r-- 1 jarvi jarvi 11 Jan 12 12:15 LCK..ttyS0 -- Trent Jarvi taj at www.linux.org.uk From ealejandro101 at hotmail.com Thu Jan 13 06:16:59 2005 From: ealejandro101 at hotmail.com (alejandro Escobar) Date: Thu, 13 Jan 2005 08:16:59 -0500 Subject: [Rxtx] Re : No enumera todos los puertos Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/fca8f69e/attachment-0022.html From Tivoli at pbworld.com Thu Jan 13 08:50:08 2005 From: Tivoli at pbworld.com (Tivoli, Christopher) Date: Thu, 13 Jan 2005 10:50:08 -0500 Subject: [Rxtx] High cpu use with no activity Message-ID: <25D454F3DBD1AF46A718F761CB11ABE101857FF9@nycmrmt1.corp.pbwan.net> Hi Trent, I'm attempting to run rxtx-2.1-6 under TRU-64 4.0G (don't ask!). I'm managing 18 channels but it appears rxtx is using ~50% of the CPU even with no writes or pending reads. The box is only 166 MHZ but should I consider this normal? Also, If you wouldn't mind entertaining a few questions from someone who only knows enough to be dangerous. In RXTXPort(): 1) Why is there a usleep(20000) (almost) immediately after the select()? 2) Am I correct that report_serial_events() is called every 20ms whether there's anything on the port or not? 3) Would there be any harm in removing the usleep and making the select() timeout 20ms so I can then only call report_serial_events() when (eis.ret > 0) instead of the current (eis.ret >= 0)? 4) With TRU-64 how can I determine if I should have TIOCSERGETLSR or TIOCGICOUNT defined or not? Thanks for your hard work, Chris Tivoli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050113/73c10617/attachment-0022.html From dmarkman at mac.com Thu Jan 13 15:19:25 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 13 Jan 2005 17:19:25 -0500 Subject: [Rxtx] Re : No enumera todos los puertos In-Reply-To: References: Message-ID: <2EA7E51B-65B1-11D9-B56A-000A95DA5E9C@mac.com> are you sure that everybody on that list understands Spanish? from other hand if Trent Jarvi does understand Spanish it would be sufficient personally I found that practice (send to the mainly English mail lists French/Spanish/Chinese e.t.c. messages) little bit annoying sorry On Jan 13, 2005, at 8:16 AM, Java RXTX discussion wrote: > Buenos d?as, > > Ya solucione el problema, mi tarjeta eqnx lista configura los puertos > en /dev con el prefijo > > ttyQ1a[1-16] > > solo cambie el gnu.io.rxtx.SerialPorts y logre que me listar? los > puertos. > > ? > > Thanks, > > > Alejandro Escobar > > > "La fidelidad, se llama discreci?n" > > > > Consigue aqu? las mejores y mas recientes ofertas de trabajo en > Am?rica Latina y USA: Haz clic aqu? > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From taj at www.linux.org.uk Mon Jan 17 13:54:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 17 Jan 2005 20:54:08 +0000 (GMT) Subject: [Rxtx] RXTX 2.0-7pre2 uploaded Message-ID: RXTX 2.0 works with Sun's comm.jar in package javax.comm. This is a sync with rxtx 2.1 native code work. I've placed rxtx-2.0-7pre2 up for testing for those that would like to give it a try. The main changes are from rxtx 2.1 64 bit fixes. thread fixes for new JREs symlink/lockfile fixes A small step that should fix far more than it breaks on primarily Unix like systems. I dont have very many ways of testing 2.0. I just put it on BlackBox and tinkered with the settings. It appeared fine here but could use much more testing. This brings 2.0 in sync with 2.1 in the native code before I add some additional fixes to both that wont be nearly as important. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Jan 18 04:44:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 18 Jan 2005 13:44:14 +0200 Subject: [Rxtx] rxtx API Message-ID: <200501181344.14371.waynetg@telkomsa.net> Hi all I'm looking for documentation for the rxtx library. I've looked around the website and I don't see so much as an API. Could anyone send me a link? Cheers Wayne btw: great job with the new install scripts! It took no time to install, last time it took hours! From taj at www.linux.org.uk Tue Jan 18 05:07:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 18 Jan 2005 12:07:57 +0000 (GMT) Subject: [Rxtx] rxtx API In-Reply-To: <200501181344.14371.waynetg@telkomsa.net> References: <200501181344.14371.waynetg@telkomsa.net> Message-ID: On Tue, 18 Jan 2005, Wayne Gemmell wrote: > Hi all > > I'm looking for documentation for the rxtx library. I've looked around the > website and I don't see so much as an API. Could anyone send me a link? > > Cheers > Wayne > > btw: great job with the new install scripts! It took no time to install, last > time it took hours! Hi Wayne The only documentated API people should follow is the Sun CommAPI documentation. Anything that deviates from Sun's Documentation is considered a bug. http://java.sun.com/products/javacomm/index.jsp It's in there someplace. At least it's in the downloadable package. That said there are undocumented methods in rxtx which offer no API stability and are strongly discouraged unless you can not do something with Sun's CommAPI. The javadoc from rxtx 2.1 can be found online. http://www.rxtx.org/doc/index.html Its not as complete as Sun's though and is not intended to be authoratative with respect to package javax.comm. That should be obvious as it is in package gnu.io. The main page would be: http://www.rxtx.org/doc/gnu/io/RXTXPort.html Note that extensions to commapi are clearly marked as such. I've been trying on and off to get phpwiki working so anyone can help cleanup the documentation. There are some issues with php5 I need to work out before that happens. I plan on opening the process a great deal more soon. We have had a fair number of glitches behind the scenes that have helped slow thngs down. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 05:43:26 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 13:43:26 +0100 Subject: [Rxtx] No blocking read on windows? Message-ID: Hi, I'm trying to convert a project running on Sun's commapi to rxtx, but am having some problems. First, on windows, I can't seem to get a read on a comm port to block infinitely. I was used to do disableReceiveTimeout(), but also tried other things like enableReceiveThreshold(), setInputBufferSize(0), but none works. By using enableReceiveTimeout() with a timeout > 0, the port does block for the time specified. Is the a way to do this, or is this a limitation of rxtx? Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that is. The driver correctly reports that things were designed for 2.4, recognizes /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support underway maybe? Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 06:44:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 13:44:34 +0000 (GMT) Subject: [Rxtx] No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi, > > I'm trying to convert a project running on Sun's commapi to rxtx, but am > having some problems. > First, on windows, I can't seem to get a read on a comm port to block > infinitely. > I was used to do disableReceiveTimeout(), but also tried other things like > enableReceiveThreshold(), setInputBufferSize(0), but none works. By using > enableReceiveTimeout() with a timeout > 0, the port does block for > the time specified. > Is the a way to do this, or is this a limitation of rxtx? Buffers are not implemented in RXTX. People can use the Normal JDK API Buffers. disableRecieveTimeout and endableReceiveThreshold should be doing what the API documentation specifies. I wasnt aware of a problem here. If you can put a simple code example showing the problem and mention Sun's behavior we can reproduce that. One thing concerning rxtx timeouts: No Unix system can have timeouts < 100. The Unix APIs have a coarser resolution. So to make all OS's behave the same, rxtx drops the last two digits regardless of the OS underneath. It may be that we never tested that condition. > > Second, I try to get rxtx working on fedora core 3, with 2.6 kernel, that > is. > The driver correctly reports that things were designed for 2.4, recognizes > /dev/ttyS1 and then crashes. Ok, I was stubborn. But is there 2.6 support > underway maybe? > The current CVS code should work on your system with 1.5 JDKs. I'm not sure what JRE or RXTX you are using now but threading issues with more recent JRE/kernels have been resolved and work here. I really need more info about which versions are involved. -- Trent Jarvi taj at www.linux.org.uk From ga at fh-furtwangen.de Thu Jan 20 06:52:08 2005 From: ga at fh-furtwangen.de (gauckler) Date: Thu, 20 Jan 2005 14:52:08 +0100 Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar Message-ID: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Hello, I'tried to find help in the WWW and in the mailing list archive but I found no hints. I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. The configure completed successfully However, the make script has still an error (joining line 5077 SerialImp.c) and hence I cannot continue gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' gnu_io_RXTXPort.h:96: error: previous declaration of `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. Is there any help available ? Best regards Andreas From taj at www.linux.org.uk Thu Jan 20 07:01:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:01:53 +0000 (GMT) Subject: [Rxtx] Trouble Installing rxtx-2.1-6.tar In-Reply-To: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> References: <000001c4fef7$3f05f9f0$c9111c8d@mikrosys.fhfurtwangen.de> Message-ID: On Thu, 20 Jan 2005, gauckler wrote: > Hello, > > I'tried to find help in the WWW and in the mailing list archive but I > found no hints. > > I try to install rxtx-2.1-6 on a PC running SuSE 9.2 Linux. > The configure completed successfully > However, the make script has still an error (joining line 5077 > SerialImp.c) and hence I cannot continue > > gcc -I/download/rxtx-2.1-6 -Ii686-pc-linux-gnu -I. > -I/usr/java/jdk1.5.0_01/include -I/usr/java/jdk1.5.0_01/include/./linux/ > -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /download/rxtx-2.1-6/src/SerialImp.c -fPIC -DPIC -o > /download/rxtx-2.1-6/i686-pc-linux-gnu/SerialImp.lo > /download/rxtx-2.1-6/src/SerialImp.c:764: error: conflicting types for > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > gnu_io_RXTXPort.h:96: error: previous declaration of > `Java_gnu_io_RXTXPort_nativeSetSerialPortParams' > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial. > > > Is there any help available ? You probably want the CVS version with jdk 1.5 for thread fixes but if you edit the configure script or configure.in if know your way around autoconf it will compile. look for something like: Linux) LDFLAGS=-lpthread check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" case $JAVA_VERSION in 1.2*|1.3*|1.4*) The last line there should be: 1.2*|1.3*|1.4*|1.5*) Then the variable in the Makefile will be completed properly when you run configure. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 06:55:58 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 14:55:58 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Thanks for the fast response. I have a Q&D test program that just attempts to read one byte, and prints the result: import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux happens in NativeisReceiveTimeoutEnabled(), but things seem to have been been messed up before, as f.i. printf("%d", 5) prints 2, or -12345 or something ;-) Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:09:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:09:16 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Hi > > Thanks for the fast response. > I have a Q&D test program that just attempts to read one byte, and prints > the result: > > import gnu.io.*; > import java.io.*; > > public class Test > { > public Test() > { > CommPortIdentifier portId; > CommPort port; > InputStream in; > > try > { > portId = CommPortIdentifier.getPortIdentifier("COM1"); > if (portId == null) > { > System.err.println("No COM1 port"); > return; > } > > port = portId.open("Test", 2000); > if (port == null) > { > System.err.println("Cannot open port"); > return; > } > > port.disableReceiveTimeout(); > > in = port.getInputStream(); > System.out.println(in.read()); > > in.close(); > port.close(); > } > catch (Exception e) > { > e.printStackTrace(); > System.exit(0); > } > } > > public static void main(String[] args) > { > new Test(); > } > } > > What is the system that the test is being run on? JRE version, RXTX version, Linux distro/version. Did you build rxtx from Source? If this is reproducable with the CVS version of rxtx that you use, this is a new bug I was not aware of. If its an older version of rxtx with a new JDK, the problem may be solved already. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Thu Jan 20 07:12:04 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Thu, 20 Jan 2005 15:12:04 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Sorry, forgot to mention the versions. I'm using 2.1-7pre17. I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar (javac complains about version 49 of a class where it expects 48; for jdk 1.5 I guess?). I tried its dlls anyway, but the problem did not disappear. Alas, I don't have access to the cvs tree (behind a firewall). Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Thu Jan 20 07:47:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 14:47:47 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Thu, 20 Jan 2005, Dierikx, Marc wrote: > Sorry, forgot to mention the versions. > > I'm using 2.1-7pre17. > I tried 2.1-7pre19 as well, but am having a problem with its RXTXcomm.jar > (javac complains about version 49 of a class where it expects 48; for jdk > 1.5 I guess?). > I tried its dlls anyway, but the problem did not disappear. > Alas, I don't have access to the cvs tree (behind a firewall). > CVS and -19 native code should be the same and should be good. Using pre19 native code with pre17 jar files is possibly really bad as some 64 bit fixes changed variable sizes. The variables are pointer addresses and that could possibly explain some of the wild behavior you see. I'm really not sure what the JNI would do in this case. I know when I forgot to change the variable while impementing the fixes, the applications exploded. Does this perhaps explain some of the obvious corruption you are seeing? The CVS source code is on ftp for you at ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I'll compile dlls too in a few minutes. I'm going to have a hard time testing anything before this weekend though. I can crosscompile everything but I dont have a w32 machine setup at the moment. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jan 20 08:08:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 20 Jan 2005 15:08:14 +0000 (GMT) Subject: [Rxtx] current rxtx 2.0 & 2.1 source and binaries. Message-ID: This is provided as we have some folkes behind firewalls with bugs that I'd like to work out against current source. rxtx 2.1 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz rxtx 2.1 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The following will be up in a few minutes for others: rxtx 2.0 source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz rxtx 2.0 binaries for Linux and w32: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 00:15:02 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 08:15:02 +0100 Subject: [Rxtx] Re: No blocking read on windows? Message-ID: Hi Trent Thanks for the fast response. Here's a Q&D test program for the blocking read on windows that just attempts to read one byte, and prints the resulting byte. On my system it returns -1, where I expect that it keeps waiting for data. import gnu.io.*; import java.io.*; public class Test { public Test() { CommPortIdentifier portId; CommPort port; InputStream in; try { portId = CommPortIdentifier.getPortIdentifier("COM1"); if (portId == null) { System.err.println("No COM1 port"); return; } port = portId.open("Test", 2000); if (port == null) { System.err.println("Cannot open port"); return; } port.disableReceiveTimeout(); in = port.getInputStream(); System.out.println(in.read()); in.close(); port.close(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void main(String[] args) { new Test(); } } The crash on linux is over in the CVS version, but takes all processor time in BlackBox. Debugging outputs lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. After initialisation it repeats isDSR returns 0 isRI returns 0 isRTS returns 4 isCTS returns 0 isDTR returns 2 ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From taj at www.linux.org.uk Fri Jan 21 02:39:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 09:39:14 +0000 (GMT) Subject: [Rxtx] Re: No blocking read on windows? In-Reply-To: References: Message-ID: On Fri, 21 Jan 2005, Dierikx, Marc wrote: > Hi Trent > > Thanks for the fast response. > Here's a Q&D test program for the blocking read on windows that just > attempts to read one byte, and prints the resulting byte. On my system it > returns -1, where I expect that it keeps waiting for data. > This isn't happening on Linux so the bug is in src/termios.c. I'll have something this weekend to fix that. > > The crash on linux is over in the CVS version, > but takes all processor time in BlackBox. Debugging outputs > lots of check_line_status_register and OUTPUT_BUFFER_EMPTY messages. > After initialisation it repeats > > isDSR returns 0 > isRI returns 0 > isRTS returns 4 > isCTS returns 0 > isDTR returns 2 BlackBox is very hackish and not maintained. So I'm slow to say there is a bug when BlackBox behaves poorly. But I did fire it up with the CVS binaries I put up. BlackBox was modified to use rxtx 2.1 by changing the packages. There are some other fixes in there but nothing I'd expect to change performance. 182 processes: 181 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 78.8% user 14.7% system 0.0% nice 0.0% iowait 6.4% idle Mem: 256660k av, 252864k used, 3796k free, 0k shrd, 5104k buff 206792k active, 4952k inactive Swap: 1052248k av, 176764k used, 875484k free 73336k cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 26640 taj 16 0 268M 26M 71980 S 0.0 10.5 0:01 0 java That is a null modem between ports ttyS0 and ttyS1 blasting at baudrate 115200 back and forth. The BlackBox scrolling is a little jerky but the GUI appears responsive on a 1.5 Ghz machine. The GUI is usually the first to show problems when a race is happening. I can't get CPU use over 0%. Perhaps there is some other modification on your end that is causing wild CPU use? Maybe top is not showing what I expect it to? The eventloop will be checking things often and printing out debug info in the eventloop could cause very high cpu use. Leaving data on serial ports will cause the eventloop to just spin controllably. -- Trent Jarvi taj at www.linux.org.uk From MDierikx at gti-group.com Fri Jan 21 07:54:08 2005 From: MDierikx at gti-group.com (Dierikx, Marc) Date: Fri, 21 Jan 2005 15:54:08 +0100 Subject: [Rxtx] RE: No blocking read in windows? Message-ID: Hi Trent, You were right about the flakyness of BlackBox. The spinning turns out to be in the showValue() methods of BaudRate, DataBits, StopBits and Parity (and more?), where the comboboxes are always selected, even when the value does not change. This leads to an itemStateChangeEvent, which in turn results in another showValue() etc. This happens on linux; I did not see it in windows. I was using jdk 1.4.2_04. Regards, Marc ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================ From wizumwalt at yahoo.com Fri Jan 21 08:55:18 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Fri, 21 Jan 2005 07:55:18 -0800 (PST) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 Message-ID: <20050121155519.70143.qmail@web52410.mail.yahoo.com> I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm working with RXTX (just installed) and am having a problem w/ my app that I also see when using the sample BlackBox app in the sun commapi. I get the same results for any apps that use or open /dev/ttyS0. If I put in another port it pops up a dialog saying port does not exist, I click ok, and then the app comes up as normal. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- $ java -classpath ./BlackBox.jar -noverify BlackBox Experimental: JNI_OnLoad called. (just hangs here at this point, no gui or anything) --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Also, I'm using the 2.0.7pre2 release (source that I built w/ the -disable-lock param) and I'm confused why it was released after the 2.1-x releases which were released earlier ... isn't that a bit backwards. I'm sure I'm not understanding something here. Any help much appreciated. __________________________________ Do you Yahoo!? All your favorites on one personal page – Try My Yahoo! http://my.yahoo.com From taj at www.linux.org.uk Fri Jan 21 09:23:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 21 Jan 2005 16:23:23 +0000 (GMT) Subject: [Rxtx] apps don't appear when trying to open /dev/ttyS0 In-Reply-To: <20050121155519.70143.qmail@web52410.mail.yahoo.com> References: <20050121155519.70143.qmail@web52410.mail.yahoo.com> Message-ID: On Fri, 21 Jan 2005, William I. Zumwalt wrote: > I'm using a gentoo 2.6.5 kernel w/ 2.0.7pre2. I'm > working with RXTX (just installed) and am having a > problem w/ my app that I also see when using the > sample BlackBox app in the sun commapi. I get the same > results for any apps that use or open /dev/ttyS0. If I > put in another port it pops up a dialog saying port > does not exist, I click ok, and then the app comes up > as normal. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > $ java -classpath ./BlackBox.jar -noverify BlackBox > Experimental: JNI_OnLoad called. > > (just hangs here at this point, no gui or anything) > --- > > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Also, I'm using the 2.0.7pre2 release (source that I > built w/ the -disable-lock param) and I'm confused why > it was released after the 2.1-x releases which were > released earlier ... isn't that a bit backwards. I'm > sure I'm not understanding something here. > > Any help much appreciated. > > > I did notice a problem with BlackBox and jre 1.4. I did not notice a problem with jre 1.5. RXTX did not print out the version numbers of the Java and Native libriaries? That should be done before anything too tricky happens. There are debug flags in RXTXPort.java and RXTXCommDriver.java that can be set to see what rxtx is doing. There is also a Zystem class instantiated in each that should pass the type of debug message you would like: protected final static boolean debug = false; protected final static boolean debug_read = false; protected final static boolean debug_read_results = false; protected final static boolean debug_write = false; protected final static boolean debug_events = false; protected final static boolean debug_verbose = false; ... try { z = new Zystem(Zystem.PRINT_MODE); ^^^^^^^^^^^^^^^^^ It may well be a bug in BlackBox. rxtx 2.1 and 2.0 are different trees performing more or less the same thing. RXTX 2.1 just replaces the Sun comm jar and is in package gnu.io to avoid having people confuse that with Sun's work. The goal is to try to release rxtx 2.1 and 2.0 at the same time. The last 2.0 release was to catch up with some of the changes that got into rxtx 2.1. I'll be releasing both at the same time now as we did with the CVS snapshots on the rxtx download page yesterday. http://www.rxtx.org/download.html -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Jan 24 04:01:03 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 24 Jan 2005 13:01:03 +0200 Subject: [Rxtx] Problems with migration Message-ID: <200501241301.03559.waynetg@telkomsa.net> Hi all I have a program that used to use the sun libraries but I want ti to use the rxtx native libraries. All I have changed is the import line but the programs fallen over. My code is as follows. try{ outputStream = sp.getOutputStream(); inputStream = sp.getInputStream(); } catch (IOException e) {} try { sp.setSerialPortParams(38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(1); } catch (UnsupportedCommOperationException e) {} try { sp.setInputBufferSize(50); sp.setOutputBufferSize(50); try { System.out.println("Resetting modem"); error is here... outputStream.write("ATZ\r".getBytes()); The output is as follows... Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Found port /dev/ttyS5 Testing serial ports Resetting modem java.io.IOException: Bad file descriptor in writeArray at gnu.io.RXTXPort.writeArray(Native Method) at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) at za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) There has never been a problem there before... Any ideas? Cheers Wayne From taj at www.linux.org.uk Mon Jan 24 06:07:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:07:23 +0000 (GMT) Subject: [Rxtx] Problems with migration In-Reply-To: <200501241301.03559.waynetg@telkomsa.net> References: <200501241301.03559.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > Hi all > > I have a program that used to use the sun libraries but I want ti to use the > rxtx native libraries. All I have changed is the import line but the programs > fallen over. My code is as follows. > > > try{ > outputStream = sp.getOutputStream(); > inputStream = sp.getInputStream(); > > } catch (IOException e) {} > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) {} > > > try { > sp.setInputBufferSize(50); > sp.setOutputBufferSize(50); > > > try { > System.out.println("Resetting modem"); > error is here... outputStream.write("ATZ\r".getBytes()); > > > The output is as follows... > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Found port /dev/ttyS5 > Testing serial ports > Resetting modem > java.io.IOException: Bad file descriptor in writeArray > at gnu.io.RXTXPort.writeArray(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1131) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:117) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > There has never been a problem there before... Any ideas? > I can not spot anything from this code. A bad filedescriptor may happen if the port was closed. The error is probably correct but sometimes the errors comming from the native code are just errors that happened earlier and may not be related to whats really wrong. Perhaps rxtx got that error while checking for lock files for example. One can place some printfs by the WRITE() in writeArray found in SerialImp.c. See if the fd is a valid positive number. See if the WRITE() really failed. If the port is closed, there is no way to write to the port and the error is valid. The input and output buffers are not used in RXTX. I really have no idea how one would access hardware buffers on all OSs. Software buffers can be found in the JDK API already. I've yet to hear a reason for implementing them in rxtx. If someone has a reason to change that, I'm all ears. There is an example of sending modem commands in the rxtx 2.1 source tarballs. contrib/SimpleSnuV1.java Perhaps that will give you some ideas. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 06:53:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 13:53:45 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241536.05697.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:22, you wrote: > > What happens if you put some debugging information in your catches? There > > may be earlier failures that are just being discarded. Maybe this problem > > goes all the way back to the start. > Hehe, your right... The problems here. > > try { > sp.setSerialPortParams(38400, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > sp.setFlowControlMode(1); > } catch (UnsupportedCommOperationException e) { > > System.out.println("Over here..."); > e.printStackTrace(); > } > > output: > > Over here... > gnu.io.UnsupportedCommOperationException: Invalid Parameter > at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:169) > at > za.co.terico.trawler.BaseStation.BaseStation.testSerial(BaseStation.java:103) > at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:82) > > > The funny thing is the same settings worked for the same modem before. > Are the rxtx libraries not a bit more sensitive than suns? Or could it > have something to do with me changing to amd64? > > If this is a 64 bit JRE you will want: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz I didnt make 64 bit bins but that source has some important 64 bit fixes fixes. Let me know if that helps, it worked here an opteron system. Make sure the rxtx native and java library versions match when upgrading as bad things happen otherwise. That would make sense as the file descriptor storage was wrong for 64 JREs in pre17. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 08:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 15:53:11 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241659.57024.waynetg@telkomsa.net> References: <200501241536.05697.waynetg@telkomsa.net> <200501241659.57024.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 15:53, you wrote: > > If this is a 64 bit JRE you will want: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > > > I didnt make 64 bit bins but that source has some important 64 bit fixes > > fixes. ?Let me know if that helps, it worked here an opteron system. ? > > Make sure the rxtx native and java library versions match when upgrading > > as bad things happen otherwise. ?That would make sense as the file > > descriptor storage was wrong for 64 JREs in pre17. > Thanks, I got it to work. the install script seems to be broken though. I ran > ./configure > ./mkinstalldirs > ./make > ./make install > > and somewhere along the line I have a working program :) > > Thanks again Glad to hear it works. mkinstalldirs is not part of the rxtx compile/install. If there was another error you saw while running the above while java was in your path and or JAVA_HOME was set, we would be interested in hearing about it. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Jan 24 09:43:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 24 Jan 2005 16:43:57 +0000 (GMT) Subject: [Rxtx] Re: RXTX .. In-Reply-To: <200501241811.17474.waynetg@telkomsa.net> References: <200501241659.57024.waynetg@telkomsa.net> <200501241811.17474.waynetg@telkomsa.net> Message-ID: On Mon, 24 Jan 2005, Wayne Gemmell wrote: > On Monday 24 January 2005 17:53, you wrote: > > Glad to hear it works. > > > > mkinstalldirs is not part of the rxtx compile/install. ?If there was > > another error you saw while running the above while java was in your path > > and or JAVA_HOME was set, we would be interested in hearing about it. > Well I thought it worked... Heres the answers to your questions first. > > I noticed one or two things in the configure script > > [wayne at Wuler] ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > > I don't know why it would come up as x86_64-unknown-linux-gnu. > > snip,snip... > > checking os.name Linux > checking os.arch amd64 > checking java.vendor Blackdown Java-Linux Team > checking java.version 1.4.2-01 > checking os.version 2.6.9-gentoo-r14 > > WARNING: Kernel include files do not match the current kernel > > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /opt/blackdown-jdk-1.4.2.01 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depfiles commands > > Nothing important, just unexpected... > > I've reinstalled it and the program just dies at the following section of > code. > > readBuffer = new byte[20]; > inputStream.read(readBuffer); > System.out.println(new String(readBuffer)); > > more specificaly the line > inputStream.read(readBuffer); > > There are no errors, it just dies. when I run serialDemo I press connect and > it dies with the comment killed. :( > > Any ideas? > The various information about your system is correct. The "unknown-linux-gnu" is just how GNU auto tools report things. The other information is extracted from Java. Header file warnings are given when an exact match to the running kernel is not found. Kernel headers varying is almost always harmless. JAVA_HOME overrides java found in $PATH so the warning is to remind people that this is happening. It sounds like something is wrong with your setup. I know gentoo is agressive about making changes but dont know if this is the exact problem: http://www.ussg.iu.edu/hypermail/linux/kernel/0407.1/0915.html It sounds like Java is getting a signal. Perhaps a signal related to RXTX. But when this happens Java is unexpectedly dying. Linux has gone through tremendous changes in threading/... and sometimes that can really come back and bite people. Thats a guess at this point. I'll try the SerialDemo tonight as that should be something I can reproduce the problems with if its not a kernel issue. You could try another kernel too. -- Trent Jarvi taj at www.linux.org.uk From gasper.pajor at cosylab.com Tue Jan 25 08:51:55 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Tue, 25 Jan 2005 16:51:55 +0100 Subject: [Rxtx] Parity problems Message-ID: <41F66B1B.1040409@cosylab.com> Hi all! I am using the RXTX for quite some time and up until recently everything worked ok. Then along came this device that I just cant get to work properly thru java in linux. It is a simple serial input device with 9 buttons and 2 dialknobs which sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for dialknob rotations. Each button has a corresponding mask, so more than one button could be down at one time. The dialknob rotation codes are out of scope for my question (i.e. I never really got to understand them :)) ) The same device works ok on windows as well as with minicom/gtkterm on linux. The settings for the device are 8E2 (which may not be a very common configuration), 1200 baud, with RTSCTS control mode. Whatever I tried, I get the parity error (8) as soon as I press a button on device, and the reply is garbled; I guess the bits are somehow shifted afterwards and I can make almost no sense from what I get. Does anybody has any suggestions on what might be wrong, is there a known issue with 2 stop bits along with parity bit in rxtx driver? Any ideas? Best Regards Gasper Pajor From wizumwalt at yahoo.com Tue Jan 25 09:26:55 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 08:26:55 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 Message-ID: <20050125162655.97027.qmail@web52402.mail.yahoo.com> kernel: gentoo 2.6.5 rxtx: 2.0.7pre2 built from source I've still got problems when I start any of my apps or those in the samples dir of the commapi that access /dev/ttyS0, all it does is print the following message: Experimental: JNI_OnLoad called. Then nothing else. No GUI's or anything, they just appear to hang. Here are the locations of the files I installed ... /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> librxtxSerial-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so --- I'm using the -noverify option to get around the ... Exception in thread "main" java.lang.VerifyError: Any help much appreciated. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Tue Jan 25 11:27:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:27:32 +0000 (GMT) Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: On Tue, 25 Jan 2005, Gasper Pajor wrote: > Hi all! > > I am using the RXTX for quite some time and up until recently everything > worked ok. > Then along came this device that I just cant get to work properly thru > java in linux. > It is a simple serial input device with 9 buttons and 2 dialknobs which > sends 5 bytes for button down, 5 bytes for button up and 5 byte sets for > dialknob rotations. > Each button has a corresponding mask, so more than one button could be > down at one time. The dialknob rotation codes are out of scope for my > question (i.e. I never really got to understand them :)) ) > > The same device works ok on windows as well as with minicom/gtkterm on > linux. > > The settings for the device are 8E2 (which may not be a very common > configuration), 1200 baud, with RTSCTS control mode. > > Whatever I tried, I get the parity error (8) as soon as I press a button > on device, and the reply is garbled; > I guess the bits are somehow shifted afterwards and I can make almost no > sense from what I get. > > Does anybody has any suggestions on what might be wrong, is there a > known issue with 2 stop bits along with parity bit in rxtx driver? > Any ideas? > I think I see the problem. I wonder if amodification like this in SerialImp.c:translate_parity() would solve the problem: int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); + #else + (*cflag) &= ~(PARENB | PARODD ); #endif /* CMSPAR */ It looks like CMSPAR is not defined on Linux so the PARODD was never getting cleared. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Tue Jan 25 11:33:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 25 Jan 2005 18:33:31 +0000 (GMT) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: <20050125162655.97027.qmail@web52402.mail.yahoo.com> References: <20050125162655.97027.qmail@web52402.mail.yahoo.com> Message-ID: On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > kernel: gentoo 2.6.5 > rxtx: 2.0.7pre2 built from source > > I've still got problems when I start any of my apps or > those in the samples dir of the commapi that access > /dev/ttyS0, all it does is print the following > message: > > Experimental: JNI_OnLoad called. > > Then nothing else. No GUI's or anything, they just > appear to hang. > > Here are the locations of the files I installed ... > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > librxtxSerial-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so -> > librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > --- > I'm using the -noverify option to get around the ... > Exception in thread "main" java.lang.VerifyError: > > Any help much appreciated. > > > I did see this with BlackBox and sun-jdk-1.4.2 but not with jdk 1.5. I thought is was perhaps a bug outside of rxtx. The VierifyError is harmless and the class causing it can be tossed out of the jar. I'm not sure what to make of the GUI issue on 1.4.2 at this point. I dont know of anything that rxtx did differently to cause the problem and it was working on early 1.4 jdks. That said, there are native threads and signals going on with rxtx that could possibly change behavior of the jdk. -- Trent Jarvi taj at www.linux.org.uk From wizumwalt at yahoo.com Tue Jan 25 14:39:56 2005 From: wizumwalt at yahoo.com (William I. Zumwalt) Date: Tue, 25 Jan 2005 13:39:56 -0800 (PST) Subject: [Rxtx] problems w/ ttyS0 In-Reply-To: Message-ID: <20050125213956.12314.qmail@web52402.mail.yahoo.com> Thanks, I had to move on to 1.5, that fixed it. I know you said to try 1.5 before, but I really wanted to get it going w/ 1.4.2, oh well. It's working. :) --- Trent Jarvi wrote: > On Tue, 25 Jan 2005, William I. Zumwalt wrote: > > > > > kernel: gentoo 2.6.5 > > rxtx: 2.0.7pre2 built from source > > > > I've still got problems when I start any of my > apps or > > those in the samples dir of the commapi that > access > > /dev/ttyS0, all it does is print the following > > message: > > > > Experimental: JNI_OnLoad called. > > > > Then nothing else. No GUI's or anything, they just > > appear to hang. > > > > Here are the locations of the files I installed > ... > > > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/RXTXcomm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/comm.jar > > /opt/sun-jdk-1.4.2.04/jre/lib/ext/jcl.jar > > > /opt/sun-jdk-1.4.2.04/jre/lib/javax.comm.properties > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libSerial.so -> > > librxtxSerial-2.0.7pre2.so > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/libParrallel.so > -> > > librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxParrallel-2.0.7pre2.so > > > /opt/sun-jdk-1.4.2.04/jre/lib/i386/librxtxSerial-2.0.7pre2.so > > > > --- > > I'm using the -noverify option to get around the > ... > > Exception in thread "main" java.lang.VerifyError: > > > > Any help much appreciated. > > > > > > > > I did see this with BlackBox and sun-jdk-1.4.2 but > not with jdk 1.5. I > thought is was perhaps a bug outside of rxtx. The > VierifyError is > harmless and the class causing it can be tossed out > of the jar. > > I'm not sure what to make of the GUI issue on 1.4.2 > at this point. I dont > know of anything that rxtx did differently to cause > the problem and it was > working on early 1.4 jdks. That said, there are > native threads and > signals going on with rxtx that could possibly > change behavior of the jdk. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From gasper.pajor at cosylab.com Wed Jan 26 03:20:34 2005 From: gasper.pajor at cosylab.com (Gasper Pajor) Date: Wed, 26 Jan 2005 11:20:34 +0100 Subject: [Rxtx] Parity problems In-Reply-To: <41F66B1B.1040409@cosylab.com> References: <41F66B1B.1040409@cosylab.com> Message-ID: <41F76EF2.5060906@cosylab.com> Hi, unfortunatly, this doesn't solve the problem :( I still get parity error. But please don't give up with giving ideas :) Regards, Gasper Pajor > I think I see the problem. > > I wonder if amodification like this in SerialImp.c:translate_parity() > would solve the problem: > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > + #else > + (*cflag) &= ~(PARENB | PARODD ); > #endif /* CMSPAR */ > > > > It looks like CMSPAR is not defined on Linux so the PARODD was never > getting cleared. From roberto.tavares at gmail.com Wed Jan 26 06:08:01 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 26 Jan 2005 11:08:01 -0200 Subject: [Rxtx] Why can't I see the lp0? Message-ID: <8d442b38050126050866833d97@mail.gmail.com> Hello, I am using rxtx, and noticed a curious behavior: As a user, I try to probe all avaliable ports. I get ttys0 only. As a root, running the same code, I get ttys0 and lp0. The permissions of the links on /dev are the same. Does anyone have an idea of why is it happen? Thanks, Roberto Tavares Neto http://www.tavares.eng.br From taj at www.linux.org.uk Wed Jan 26 08:54:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 15:54:26 +0000 (GMT) Subject: [Rxtx] Why can't I see the lp0? In-Reply-To: <8d442b38050126050866833d97@mail.gmail.com> References: <8d442b38050126050866833d97@mail.gmail.com> Message-ID: On Wed, 26 Jan 2005, Roberto Tavares wrote: > Hello, > > I am using rxtx, and noticed a curious behavior: > > As a user, I try to probe all avaliable ports. I get ttys0 only. > As a root, running the same code, I get ttys0 and lp0. > > The permissions of the links on /dev are the same. > > Does anyone have an idea of why is it happen? > > Thanks, > [root at alaska rxtx]# ls -l /dev/lp0 /dev/ttyS0 crw-rw---- 1 root lp 6, 0 Aug 31 13:37 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Jan 26 08:36 /dev/ttyS0 Try adding the user to group lp or whatever your distro shows above. -- Trent Jarvi taj at www.linux.org.uk From kim at poksi.ru Wed Jan 26 08:04:40 2005 From: kim at poksi.ru (Konstantin K.Y.) Date: Wed, 26 Jan 2005 18:04:40 +0300 Subject: [Rxtx] baudrates Message-ID: <1624056531.20050126180440@poksi.ru> Hello rxtx, I'm use USB-to-serial tranciever Prolific PL2303 In WinXP it worked fine in up to 1228800 bps via SetCommState. Can you add it nonstandard rate. -- Best regards, Konstantin mailto:kim at poksi.ru From taj at www.linux.org.uk Wed Jan 26 11:07:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 26 Jan 2005 18:07:44 +0000 (GMT) Subject: [Rxtx] baudrates In-Reply-To: <1624056531.20050126180440@poksi.ru> References: <1624056531.20050126180440@poksi.ru> Message-ID: On Wed, 26 Jan 2005, Konstantin K.Y. wrote: > Hello rxtx, > > I'm use USB-to-serial tranciever Prolific PL2303 > In WinXP it worked fine in up to 1228800 bps via SetCommState. > Can you add it nonstandard rate. > > Yes we can add this baud rate. There are several we need to add but that will come after resolving some other windows problems mentioned on the list. It is possible to just hard code the baud rate into the termios.c source code but that is something you would have to do on your end. It will take time to get the fix on this side as it has to be done right on all OSs. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Wed Jan 26 16:38:36 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 26 Jan 2005 18:38:36 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? Message-ID: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Greetings, Setup: Mac OS X 10.3.7 running Apple's JRE build 1.4.2_05-141.3. RXTX 2.0-7pre1 binaries installed. Using a Keyspan USA-28 USB serial port adapter thingy. I've got some simple code that creates a SerialPort (using a Keyspan adapter port), leaves the serial port params at their defaults, gets the InputStream, and calls read() on the InputStream. The read() call blocks just fine if there's no data available. Unfortunately while read() is blocking the CPU utilization goes through the roof - Apple's Activity Monitor shows the CPU fully util